@extends('admin')
@section('style')
    <style xmlns="http://www.w3.org/1999/html">
        .pager{ width: 40%;margin:0 auto; }
        .pagination li {
            width: 27px !important;
            margin: 2px !important;
        }
        #data_list ul li>img{ width: 343px; height: 238px; }
    </style>
@stop
@section('content')


    <div class="h_a">搜索</div>
    <div class="search_type cc mb10">
        <form action="{{url('admin/contest')}}" method="get" class="search_form">
            <label for="search_title">查询</label>
            <input type="text" name="title" id="search_title" class="input length_2 mr10" placeholder="请输入推广语"/>
            <button type="submit" class="btn">提交查询</button>
        </form>

    </div>

    <div class="table_list">
        <div id="data_list">
            <table class="items">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>推广语</th>
                    <th>创意说明</th>
                    <th>得票</th>
                    <th>作者</th>
                    <th>昵称</th>
                    <th>联系方式</th>
                    <th>提交时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                @foreach ($items as $key=>$item)
                    <tr>
                        <td>{{$item->id}}</td>
                        <td>{{$item->advertisement}}</td>
                        <td>{{$item->explain}}</td>
                        <td>{{$item->vote}}</td>
                        <td>{{$item->author}}</td>
                        <td>{{$item->nickname}}</td>
                        <td>{{$item->phone}}</td>
                        <td>{{$item->created_at}}</td>
                        <td>
                            <a href="{{url('admin/contest/delete/'.$item->id)}}" class="mr10 J_ajax_del">[删除]</a>
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>

        <div class="summary">
            共有 {{$items->total()}} 条数据
        </div>


        @if ($items->hasPages())
            <div class="pager">
                {!! $items->appends($appends)->render() !!}
            </div>
        @endif
    </div>
@stop